
//------------------------------------------------------------
// We can have any length of curve with this example so i thought
// it'd be a good idea to illustrate both the bezier points from
// earlier, and the nurbs CV's coming up later.
//


#define NUM_POINTS 5

	//	The following sets of 4 indices are the curves that need to
	//	be drawn to create a clamped cubic b-spline. In total there
	//	are 5 curve segments to draw.
	//
	//	0 0 0 1
	//    0 0 1 2
	//      0 1 2 3
	//        1 2 3 3
	//          2 3 3 3
	//
	//	Remember this when trying to understand knot vectors!!
	//



class BSpline
{
    public:
    float* getPoint(int i);
    float* interpolate( float x , int s = 0);
    int findClosestPoint( float x );
    float getMaxX();
    float getLength();
    float* getPhantomStartPoint();
    float* getPhantomEndPoint();
    float getXForStartCV(int start_cv);
    float getTFromX(float x);
    int getStartCVFromX(float x);
    void draw();
    float points[4][3];
    BSpline();

};

